package com.bckj.freshnow.order.mapper;

import com.bckj.freshnow.order.entity.TradeMarketingInfo;
import com.bckj.freshnow.order.model.TradeMarketingInfoResponse;
import com.bckj.freshnow.order.model.TradeMarketingInfoRequest;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.jdbc.SQL;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;

/**
 * 交易订单营销信息表(TradeMarketingInfo)表数据库访问层
 *
 * @author makejava
 * @since 2025-04-22 15:01:36
 */
@Mapper
public interface TradeMarketingInfoMapper extends BaseMapper<TradeMarketingInfo> {

    /**
      * 列表
      *
      * @param request req
      * @return list
      */
    @SelectProvider(method = "findAll" , type = TradeMarketingInfoProvider.class)
    List<TradeMarketingInfoResponse> findAll(TradeMarketingInfoRequest request);
    
    class TradeMarketingInfoProvider{
        
        public String findAll(TradeMarketingInfoRequest request){
            SQL sql = new SQL();
            sql.SELECT("id, order_id, marketing_type, marketing_id, marketing_id_type, discount_amount, title, marketing_remark, discount_range, value, create_time");
            sql.FROM("trade_marketing_info");
            return sql.toString();
        }
    }
}

